import request from "@/utils/request"
export default {
    //分页查询
    search(page, size, searchMap) {
        return request({
            url: 'students/list',
            method: 'post',
            data: {
                page,
                size,
                searchMap
            }
        })
    },
    //新增
    add(student) {
        return request({
            url: '/students',
            method: 'post',
            data: student
        })
    },
    // 根据id查询学员
    getById(id) {
        return request({
            url: `/students?id=${id}`,
            method: 'get'
        })
    },
    // 修改学员信息
    update(student){
        return request({
            url:`/students`,
            method:'put',
            data:student
        })
    },
    //删除学员
   deleteById(id){
       return request({
           url:`/students`,
           method:'delete',
           data:{
               id
           }
       })
   }
}